<?php
define('IN_QY',true);
require("include/common.inc.php");	

$sqlshua = "select * from tbl_tutu where userid='".$_COOKIE['userid']."'";
$queryshua=mysql_query($sqlshua);
$rowshua=mysql_fetch_array($queryshua);

$sqla = "select * from tbl_user where id='".$_COOKIE['userid']."'";
$querya=mysql_query($sqla);
$rowa=mysql_fetch_array($querya);

if ($_GET['act']=='add') {
	$gxqm=$_POST['gxqm'];
	$xb=$_POST['xb'];
	$date=$_POST['date'];
	$email=$_POST['email'];
	
$sql="update tbl_tutu set content='".$gxqm."', xbie='".$xb."', birthday='".$date."', ifweizhi='".$email."', youx=1 where userid=".$_COOKIE['userid'];
$query=mysql_query($sql);

$sql1="update tbl_user set shuyu='".$_POST['nickname']."' where id='".$_COOKIE['userid']."'";
mysql_query($sql1);


echo "<script type='text/javascript'>alert('修改成功');location.href='my.php';</script>";
}
?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title><?=$_COOKIE['shuyu']?>/修改个人资料-众晒网</title>
    <link href="/ui/css/Hui.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
     #header{width:100%; position:absolute; top:0;}
     #footer{width:100%; height:55px; position:absolute; bottom:0;}	 
     #main{width:100%; overflow: auto; position:absolute; top:45px;bottom:0px;}
     span.H-vertical-middle.H-padding-horizontal-left-10.H-theme-background-color-white.H-font-size-16 {width: 90px;}
     input.H-textbox.H-vertical-align-middle.H-vertical-middle.H-font-size-16.H-flex-item.H-box-sizing-border-box.H-border-none.H-outline-none.H-padding-12 { overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
    </style>
    <script src="/ui/js/jquery.min.js"></script>

</head>
<body>
    <header class="H-header H-theme-background-color-white" id="header">
        <span tapmode="" onclick="H.closeWin();" class="H-icon H-position-relative H-display-inline-block H-float-left H-vertical-middle H-theme-font-color-white H-padding-horizontal-left-10 H-z-index-100"><i class="H-iconfont H-icon-arrow-left H-theme-font-color-black H-font-size-18 H-vertical-middle"></i></span>
        <div class="H-header-title H-center-all H-font-size-18 H-text-show-row-1 H-theme-font-color-black H-position-absolute H-width-100-percent H-font-weight-500">修改个人资料</div>
    </header>

 <form action="?act=add" id="form1" method="post" name="addform"  enctype="multipart/form-data" onSubmit="return beforeSubmit(this);">
    <div id="main">
	 <div class="H-padding-vertical-bottom-10"></div>
     <div class="H-border-vertical-both-after">
     
	        <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
            <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-16">昵称:&nbsp;&nbsp;&nbsp;&nbsp;</span><input type="text" name="nickname" class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-16 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" value="<?=$rowa['shuyu']?>" placeholder="请输入昵称" />
        </div> 
		
        <!--<div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
            <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-16">个性签名:&nbsp;&nbsp;&nbsp;&nbsp;</span><input type="text" name="gxqm" class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-16 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" value="<?=$rowshua['content']?>" placeholder="彰显你的个性" />
        </div>-->
		    <div class="H-flexbox-horizontal H-margin-vertical-bottom-10">
		<span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-16">选择性别:&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <input name="xb" type="text" class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-16 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" placeholder="请选择您的性别" value="<?=$rowshua['xbie']?>" readonly="readonly" tapmode="" onclick="H.selectTip(this, ['男', '女', '保密'])" /><span class="H-icon H-vertical-middle H-padding-horizontal-right-10 H-theme-background-color-white"><i class="H-iconfont H-icon-arrow-down H-font-size-16 H-vertical-middle H-theme-font-color-999"></i></span>
    </div>
        <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
            <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-16">出生日期:&nbsp;&nbsp;&nbsp;&nbsp;</span>
            <input type="text" name="date"  class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-16 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12 H-width-12" placeholder="请选择您的出生日期" value="<?=$rowshua['birthday']?>" readonly="readonly" tapmode="" onclick="H.dateTip(this );" /><span class="H-icon H-vertical-middle H-padding-horizontal-right-10 H-theme-background-color-white"><i class="H-iconfont H-icon-time H-font-size-16 H-vertical-middle H-theme-font-color-999"></i></span>
        </div>

        <div class="H-flexbox-horizontal H-border-vertical-bottom-margin-left-10-after">
            <span class="H-vertical-middle H-padding-horizontal-left-10 H-theme-background-color-white H-font-size-16">常住地&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;</span><input type="text" name="email" value="<?=$rowshua['ifweizhi']?>" class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-16 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" placeholder="输入您常住地" />
        </div>
		

		
		
<div class="Validform_checktip"></div>
    </div>

<div style="margin-top:20px">
    <center>
    <button class="H-button H-width-100-percent  H-font-size-15 H-outline-none H-theme-background-color-transparent H-padding-vertical-both-8 H-padding-horizontal-both-20 H-theme-font-color8 H-theme-border-color8 H-theme-border-color8-click H-theme-background-color8-click H-theme-font-color8-click H-border-radius-3" style="width:80%">确定修改</button>
    </center>
        </div>
    </div>

    </form> 

     <!--################################底部开始################################-->  	
    <?include('footer.php');?>
     <!--################################底部结束################################-->
    <script src="/ui/script/H.js" type="text/javascript"></script>
	<script type='text/javascript' src='/wap/dl/zc/js/LocalResizeIMG.js'></script>
	<script type='text/javascript' src='/wap/dl/zc/js/patch/mobileBUGFix.mini.js'></script>
<script type="text/javascript" src="/wap/dl/zc/js/jquery.flexslider-min.js"></script>
<script type="text/javascript">
function beforeSubmit(form){
    if (document.addform.nickname.value==""){
        alert('请输入昵称');
        document.addform.gxqm.focus();
        return false;
    }	
    if (document.addform.gxqm.value==""){
        alert('起个个性名字吧！');
        document.addform.gxqm.focus();
        return false;
    }
    if (document.addform.xb.value==""){
        alert('请确定您的性别！');
        document.addform.xb.focus();
        return false;
     }
   
    if (document.addform.date.value==""){
        alert('让我们记住您的生日！');
        document.addform.date.focus();
        return false;
    }

var reg = /^(\w)+(\.\w+)*@(\w)+((\.\w{2,3}){1,3})$/;;


    mui("#input_example input").each(function() {
//若当前input为空，则alert提醒 
		if(!this.value || this.value.trim() == "") {
		    var label = this.previousElementSibling;
		    mui.alert(label.innerText + "不允许为空");
		    check = false;
		    return false;
		}
	}); //校验通过，继续执行业务逻辑 
	if(check){
	    mui.alert('验证通过!')
	}

    document.addform.submit();
    return true;  
}
</script>		
 
</body>
</html>